@extends('layouts.tankuang')

@section('content')
        <form name="add_form" id="add_form" action="http://nb.yntosite.com/admin/xz/add_zxup/{{$id}}/other/{{$jrid}}" method="post" enctype="multipart/form-data">
            <input type="hidden" name="_token" value="{{ csrf_token() }}">
            <div id="div_print">
                <h2 class="text-center mg_b36 mg_t25" style="font-weight:bold;">{{$uptype->name}}</h2>
                <table class="table-form table-border w mg-auto">
                    <tbody>



                    @foreach($re as $key =>$v)
                        <tr>
                        <td class="font-bd">
                        @if(($key+1) == 1)
                        材料一
                        @elseif(($key+1) == 2)
                        材料二
                         @elseif(($key+1) == 3)
                        材料三
                         @elseif(($key+1) == 4)
                        材料四
                         @elseif(($key+1) == 5)
                        材料五
                        @endif
                        </td>

                        <td colspan="5">
                            <div class="example" style="width: 190px;">

                            @if($v->other_type == 'docx')
                            <a href="{{ URL::asset('/') }}{{$v->wj_url}}" type="application/msword">点击下载</a>
                            @else
                            <img src="{{ URL::asset('/') }}{{$v->wj_url}}" class="img-rounded" alt="" style="width: 190px;border-radius: 0;">
                            @endif



                            </div>
                        </td>
                    </tr>
                    @endforeach

                    <link rel="stylesheet" href="{{ URL::asset('/') }}css/zoomify.min.css">
                    <script src="{{ URL::asset('/') }}js/zoomify.min.js"></script>
                    <script type="text/javascript">
                        $('.example img').zoomify(function(){
                            $(this).css({'position':'absolute','top':0,'bottom':0,'left':0,'right':0,'z-index':'9999',})
                        });
                    </script>
                    
                    
                    @if($count == 0)
                    <tr>
                        <td class="font-bd">材料一</td>
                        <td colspan="5"><input type="file" name="pic[]" style="width: 140px"></td>
                    </tr>
                    <tr>
                        <td class="font-bd">材料二</td>
                        <td colspan="5"><input type="file" name="pic[]" style="width: 140px"></td>
                    </tr>
                    <tr>
                        <td class="font-bd">材料三</td>
                        <td colspan="5"><input type="file" name="pic[]" style="width: 140px"></td>
                    </tr>
                    <tr>
                        <td class="font-bd">材料四</td>
                        <td colspan="5"><input type="file" name="pic[]" style="width: 140px"></td>
                    </tr>
                    <tr>
                        <td class="font-bd">材料五</td>
                        <td colspan="5"><input type="file" name="pic[]" style="width: 140px"></td>
                    </tr>
                    @endif

                     @if($count == 1)
                     <tr>
                        <td class="font-bd">材料二</td>
                        <td colspan="5"><input type="file" name="pic[]" style="width: 140px"></td>
                    </tr>
                    <tr>
                        <td class="font-bd">材料三</td>
                        <td colspan="5"><input type="file" name="pic[]" style="width: 140px"></td>
                    </tr>
                    <tr>
                        <td class="font-bd">材料四</td>
                        <td colspan="5"><input type="file" name="pic[]" style="width: 140px"></td>
                    </tr>
                    <tr>
                        <td class="font-bd">材料五</td>
                        <td colspan="5"><input type="file" name="pic[]" style="width: 140px"></td>
                    </tr>
                     @endif

                     @if($count == 2)
                    <tr>
                        <td class="font-bd">材料三</td>
                        <td colspan="5"><input type="file" name="pic[]" style="width: 140px"></td>
                    </tr>
                    <tr>
                        <td class="font-bd">材料四</td>
                        <td colspan="5"><input type="file" name="pic[]" style="width: 140px"></td>
                    </tr>
                    <tr>
                        <td class="font-bd">材料五</td>
                        <td colspan="5"><input type="file" name="pic[]" style="width: 140px"></td>
                    </tr>
                     @endif


                    @if($count == 3)
                    <tr>
                        <td class="font-bd">材料四</td>
                        <td colspan="5"><input type="file" name="pic[]" style="width: 140px"></td>
                    </tr>
                    <tr>
                        <td class="font-bd">材料五</td>
                        <td colspan="5"><input type="file" name="pic[]" style="width: 140px"></td>
                    </tr>
                     @endif

                     @if($count == 4)
                    <tr>
                        <td class="font-bd">材料五</td>
                        <td colspan="5"><input type="file" name="pic[]" style="width: 140px"></td>
                    </tr>
                     @endif

                    </tbody>
                </table>

            
                <div class="w wbt mg_t25 pd_b20 text-center">
               <!--  <input type="submit">确定</input> -->
                    <button id="go" type="button" class="easyui-linkbutton dsp" data-options="iconCls:'icon-save'">确定</button>
                    <button type="button" class="easyui-linkbutton dsp" data-options="iconCls:'icon-no'" onclick="$('#tk').window('close')">关闭</button>
                </div>
            </div>
        </form>

        
        <script>
            $('#go').click(function (){

                var url = 'edit_zxup/'+{{$id}}+'/other/'+{{$jrid}};
                var formData = new FormData($("#add_form")[0]);
                    $.ajax({
                    cache: true,
                    type: "POST",
                    url: url,
                    data: formData,
                    async: false,
                    contentType: false,
                    processData: false,
                    success: function(data) {
                        if(data.status == 1){
                            $.messager.alert('信息提示',data.msg,'info');
                            $('#tk').dialog('close');
                           
                        }else {
                            $.messager.alert('信息提示',data.msg,'info');
                        }
                    }
                });
            });
        </script>

       



@stop